import { getAction, deleteAction, putAction, postAction, httpAction,postActionByParams } from '@/api/manage'

const baseUrl = '/jeecg-fz'

//锁定规则
//预警策略锁定规则表-分页列表查询
const ruleList = (params)=>getAction(publicApi.ruleList,params);
//预警策略锁定规则表-添加
const ruleAdd = (params)=>postAction(`${baseUrl}/earlyWarnPloyLockrule/add`,params);
//预警策略锁定规则表-编辑
const ruleEdit = (params)=>putAction(`${baseUrl}/earlyWarnPloyLockrule/edit`,params);
//预警策略锁定规则-用户分页列表查询
const userRoleList = (params)=>getAction(`/sys/user/userRoleList`,params);
//预警策略锁定用户-添加
const lockUserAdd = (params)=>postActionByParams(`${baseUrl}/earlyWarnPloyLockrule/addLockuser`,params);
//预警策略锁定规则-锁定用户列表查询
const lockUserList = (params)=>getAction(`${baseUrl}/earlyWarnPloyLockrule/lockuserList`,params);

//验证管理
//预警策略验证管理表-添加
const verifyAdd = (params)=>postAction(`${baseUrl}/earlyWarnPloyVerify/add`,params);
//预警策略验证管理表-编辑
const verifyEdit = (params)=>putAction(`${baseUrl}/earlyWarnPloyVerify/edit`,params);
//预警策略验证管理表-通过id查询
const verifyQueryById = (params)=>getAction(`${baseUrl}/earlyWarnPloyVerify/queryById`,params);
//预警策略开启验证表-设置开关
const verifySwitch = (params)=>putAction(`${baseUrl}/earlyWarnPloyOpenverify/edit`,params);
//预警策略开启验证表-获取验证账号状态
const verifyAccountStatus = (params)=>getAction(`${baseUrl}/earlyWarnPloyOpenverify/query`,params);

//指派列表
//预警策略指派列表-获取开关
const designateSwitchStatus = (params)=>getAction(`${baseUrl}/earlyWarnPloyAppoint/switchStatus`,params);
//预警策略指派列表-开关状态修改
const designateSwitch = (params)=>putAction(`${baseUrl}/earlyWarnPloyAppoint/switchUpdate`,params);

//策略配置
//预警策略配置表-添加
const policyConfigAdd = (params)=>postAction(`${baseUrl}/earlyWarnPloyConfig/add`,params);
//预警策略配置表-编辑
const policyConfigEdit= (params)=>putAction(`${baseUrl}/earlyWarnPloyConfig/edit`,params);
//预警策略配置表-通过id查询
const policyConfigQueryById = (params)=>getAction(`${baseUrl}/earlyWarnPloyConfig/queryById`,params);
//预警策略配置表-设置开关
const policyConfigUpdateStatus= (params)=>putAction(`${baseUrl}/earlyWarnPloyConfig/updateStatus`,params);
//预警策略配置表-通过id删除
const policyConfigDelete= (params)=>deleteAction(publicApi.policyConfigDelete,params);

const publicApi = {
    ruleList: `${baseUrl}/earlyWarnPloyLockrule/pageList`,//预警策略锁定规则表-分页列表查询
    ruleDelete: `${baseUrl}/earlyWarnPloyLockrule/delete`,//预警策略锁定规则表-通过id删除
    verifyManageList: `${baseUrl}/earlyWarnPloyVerify/pageList`,//预警策略验证管理表-分页列表查询
    verifyManageDelete: `${baseUrl}/earlyWarnPloyVerify/delete`,//预警策略验证管理表-通过id删除
    designateList: `${baseUrl}/earlyWarnPloyAppoint/pageList`,//预警策略指派列表-分页列表查询
    designateImportExcel:`${baseUrl}/earlyWarnPloyAppoint/importExcel`,//预警策略指派列表-导入Xls
    designateExportExcel:`${baseUrl}/earlyWarnPloyAppoint/exportXls`,//预警策略指派列表-导出Xls
    designateDeleteBatch:`${baseUrl}/earlyWarnPloyAppoint/deleteBatch`,//预警策略指派列表-批量删除
    designateDelete:`${baseUrl}/earlyWarnPloyAppoint/delete`,//预警策略指派列表-通过id删除
    policyConfigList:`${baseUrl}/earlyWarnPloyConfig/list`,//预警策略配置表-分页列表查询
    policyConfigDelete:`${baseUrl}/earlyWarnPloyConfig/delete`,//预警策略配置表-通过id删除
}
export {
    publicApi,
    ruleList,
    ruleAdd,
    ruleEdit,
    userRoleList,
    lockUserAdd,
    lockUserList,
    verifyAdd,
    verifyEdit,
    verifyQueryById,
    verifySwitch,
    verifyAccountStatus,
    policyConfigAdd,
    policyConfigEdit,
    policyConfigQueryById,
    policyConfigDelete,
    policyConfigUpdateStatus,
    designateSwitchStatus,
    designateSwitch
}
